pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    if threshold == 0 {
        return 0;
    }

    let mut a = 0;
    let mut b = 1;
    let mut result = 1;

    loop {
        let c = a + b;
        if c >= threshold {
            return result;
        }

        if c % 2 == 1 {
            result += c
        }

        a = b;
        b = c;
    }
}
